<html>

<head>
    <meta charset="UTF-8">
    <title>服务编排变量列表</title>
    <link id="easyuiTheme"  href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
    <script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
    <script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
    <script src="../../ffres/dict/all.js" type="text/javascript"></script>
    <a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">
    var appModelId = $.getUrlParam('appModelId');
    const appModelCatalog = "I01";
    var returnFunc = $.getUrlParam('returnFunc');

    function onDblClickRow(index,row) {
        window.parent[returnFunc] && window.parent[returnFunc](row);
        window.parent.JLEUtil.closewin();
    }

    function selectReturn() {
        var row = $('#dg').datagrid('getSelected');
        if (row) {
            onDblClickRow(-1, row);
        } else {
            $.messager.alert('提示', '请选择一条记录！', 'info');
        }
    }

    function closeForm() {
        window.parent.JLEUtil.closewin();
    }


    function reloadList() {
        $('#dg').datagrid({
            url: `../../api/osrv/arrange/vars`,
            queryParams:{
                'appModelId': appModelId,
            }
        });
    };
    $(function () {
        $('#dg').datagrid({
            url: `../../api/osrv/arrange/vars`,
            queryParams:{
                'appModelId': appModelId,
            }
        });
    });
</script>
</head>

<body class="easyui-layout">

    <div data-options="region:'center',split:false">
        <table id="dg" class="easyui-datagrid" title="" style="width:100%;height:90%"
            data-options="singleSelect:true,collapsible:true,method:'post',onDblClickRow:onDblClickRow" title="Load Data"
            rownumbers="true" pagination="true" pageSize="20">
            <thead>
                <tr>
                    <th hidden data-options="field:'appModelId',resizable:true" >应用模型标识</th>
                    <th hidden data-options="field:'varId',resizable:true" >变量标识</th>
                    <th data-options="field:'varName',resizable:true" >变量名称</th>
                    <th data-options="field:'varType',resizable:true" formatter="formatter_VAR_TYPE">变量类型</th>
                    <th data-options="field:'varModelId',resizable:true" >变量对应领域模型</th>
                    <th data-options="field:'varTableRowNo',resizable:true" >变量对应编排表格行号</th>
                </tr>
            </thead>
        </table>
        <div style="text-align: center; padding: 15px;height: 10%;">
            <a href="javascript:void(0)" class="easyui-linkbutton"
               onclick="selectReturn()">&nbsp;选择返回&nbsp;</a>
            <a href="javascript:void(0)" class="easyui-linkbutton"
               onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
        </div>
    </div>
</body>

</html>